import request from '@/utils/request'

// 查询组织架构列表
export function getDepartments() {
  return request.get('/company/department')
}

// 获取部门负责人
export function getEmployeesSimple() {
  return request.get('/sys/user/simple')
}

// 新增子部门
export function addDepartments(data) {
  return request.post('/company/department', data)
}

// 获取部门详情
export function getDepartmentsDetail(id) {
  return request.get(`/company/department/${id}`)
}

// 编辑部门
export function editDepartments(data) {
  return request.put(`/company/department/${data.id}`, data)
}

// 删除部门
export function delDepartment(id) {
  return request.delete(`/company/department/${id}`)
}
